package com.nintendo.controller;

import com.nintendo.pojo.Users;
import com.nintendo.result.GraceJSONResult;
import com.nintendo.service.UsersTSTService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/users")
public class UsersTSTController {
    @Autowired
    private UsersTSTService usersTSTService;
    @PostMapping("/search-users-by-mobile")
    public GraceJSONResult searchUsersByMobile(@RequestParam("mobile") String mobile,
                                               HttpServletRequest request) {
        Users users = usersTSTService.searchUsersByMobile(mobile,request);
        return GraceJSONResult.ok(users);
    }
}
